import pandas as pd
import matplotlib.pyplot as plt

duringTimes = pd.read_csv('data/四川各地上班时长统计.csv',encoding='utf-8')
print(duringTimes)
city_groupby = duringTimes['平均上班时长'].groupby(duringTimes['城市']).count() #按学历分组 count统计re人数

plt.figure(figsize=(6,5))#设置画布大小
valuelist = list(city_groupby)
namelist = list(city_groupby.keys())
plt.rcParams['font.sans-serif'] = 'SimHei'
plt.title ='四川各地上班时常'
explode=(0,0,0.2,0.1,0,0)#离心率
plt.pie(valuelist,explode=explode,labels=namelist,autopct='%1.3f%%',
        shadow=False,startangle=150)
plt.show()